import os

os.rename("a.text","b.txt")